package com.cn.system.controller;

import com.cn.system.entity.BaseResponse;
import com.cn.system.entity.TCards;
import com.cn.system.service.BaseService;
import com.cn.system.service.impl.TCardsServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/card")
public class TCardsController implements BaseController<TCards> {

  @Resource(name="tCardsServiceImpl")
  private BaseService baseService;


  /**
   * 根据起始下标和结束下标获取数据
   * @param startIndex 开始下标
   * @param endIndex 结束下标
   * @return 返回对应的集合数据
   */
  @Override
  @GetMapping("/page")
  public BaseResponse<TCards> list(@RequestParam int startIndex , @RequestParam int endIndex, TCards t) {
    return baseService.page(startIndex, endIndex, t);
  }

  /**
   * 跟新数据库信息
   * @param t
   * @return
   */
  @Override
  @PostMapping("/update")
  public BaseResponse<TCards> update(@RequestBody TCards t) {
    return null;
  }

  /**
   * 删除数据库信息
   * @param t 数据库的唯一标识
   * @return
   */
  @Override
  @PostMapping("/delete")
  public BaseResponse<TCards> delete(@RequestBody  String t) {
    return null;
  }

  /**
   * 添加信息
   * @param t
   * @return
   */
  @Override
  @PostMapping(value="add")
  public BaseResponse<TCards> add(@RequestBody  TCards t) {
    return null;
  }
}
